package com.starlink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.starlink.common.PageInfoTwo;
import com.starlink.model.domain.MallBooksSpecificationDO;
import com.starlink.model.request.save.MallBooksSpecificationSaveRequest;
import com.starlink.model.request.MallBooksSpecificationRequest;
import com.starlink.model.vo.MallBooksSpecificationVO;

import java.util.List;
import java.util.Map;

/**
 * @author zhanghong
 */
public interface MallBooksSpecificationService extends IService<MallBooksSpecificationDO> {

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    MallBooksSpecificationVO getByKey(long id);
    /**
     * 分页查询，手动分页
     * @param request
     * @return
     */
    PageInfoTwo<MallBooksSpecificationVO> pageQuery(MallBooksSpecificationRequest request);
    /**
     * 列表查询
     * @param request
     * @return
     */
    List<MallBooksSpecificationVO> listQuery(MallBooksSpecificationRequest request);
    /**
     * 新增
     * @param request
     * @return
     */
    Boolean add(MallBooksSpecificationSaveRequest request);
    /**
     * 根据主键更新
     * @param request
     * @return
     */
    Boolean updateByKey(MallBooksSpecificationSaveRequest request);
    /**
     * 根据主键删除
     * @param id
     * @return
     */
    Boolean deleteDOById(Long id);

    /**
     * 订单减库存
     * @param quantityMap
     */
    void updateQuantity(Map<String, Long> quantityMap);

    /**
     * 订单归还库存
     * @param quantityMap
     */
    void addQuantity(Map<String, Long> quantityMap);

    /**
     * 减库存
     * @param map
     */
    void subQuantity(Map<String, Long> map);
}